package com.ruoyi.order.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.order.mapper.SetMealDishRelationMapper;
import com.ruoyi.order.domain.SetMealDishRelation;
import com.ruoyi.order.service.ISetMealDishRelationService;

/**
 * 套餐菜品关系Service业务层处理
 * 
 * @author ruoyi
 * @date 2022-08-19
 */
@Service
public class SetMealDishRelationServiceImpl implements ISetMealDishRelationService 
{
    @Autowired
    private SetMealDishRelationMapper setMealDishRelationMapper;

    /**
     * 查询套餐菜品关系
     * 
     * @param setMealDishRelationId 套餐菜品关系主键
     * @return 套餐菜品关系
     */
    @Override
    public SetMealDishRelation selectSetMealDishRelationBySetMealDishRelationId(Long setMealDishRelationId)
    {
        return setMealDishRelationMapper.selectSetMealDishRelationBySetMealDishRelationId(setMealDishRelationId);
    }

    /**
     * 查询套餐菜品关系列表
     * 
     * @param setMealDishRelation 套餐菜品关系
     * @return 套餐菜品关系
     */
    @Override
    public List<SetMealDishRelation> selectSetMealDishRelationList(SetMealDishRelation setMealDishRelation)
    {
        return setMealDishRelationMapper.selectSetMealDishRelationList(setMealDishRelation);
    }

    /**
     * 新增套餐菜品关系
     * 
     * @param setMealDishRelation 套餐菜品关系
     * @return 结果
     */
    @Override
    public int insertSetMealDishRelation(SetMealDishRelation setMealDishRelation)
    {
        setMealDishRelation.setCreateTime(DateUtils.getNowDate());
        return setMealDishRelationMapper.insertSetMealDishRelation(setMealDishRelation);
    }

    /**
     * 修改套餐菜品关系
     * 
     * @param setMealDishRelation 套餐菜品关系
     * @return 结果
     */
    @Override
    public int updateSetMealDishRelation(SetMealDishRelation setMealDishRelation)
    {
        setMealDishRelation.setUpdateTime(DateUtils.getNowDate());
        return setMealDishRelationMapper.updateSetMealDishRelation(setMealDishRelation);
    }

    /**
     * 批量删除套餐菜品关系
     * 
     * @param setMealDishRelationIds 需要删除的套餐菜品关系主键
     * @return 结果
     */
    @Override
    public int deleteSetMealDishRelationBySetMealDishRelationIds(Long[] setMealDishRelationIds)
    {
        return setMealDishRelationMapper.deleteSetMealDishRelationBySetMealDishRelationIds(setMealDishRelationIds);
    }

    /**
     * 删除套餐菜品关系信息
     * 
     * @param setMealDishRelationId 套餐菜品关系主键
     * @return 结果
     */
    @Override
    public int deleteSetMealDishRelationBySetMealDishRelationId(Long setMealDishRelationId)
    {
        return setMealDishRelationMapper.deleteSetMealDishRelationBySetMealDishRelationId(setMealDishRelationId);
    }
}
